import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Date;
import java.util.Scanner;

public class Test {
    public static final Logger LOGGER = LoggerFactory.getLogger(Test.class);

    public static void main(String[] args) {

        //登录操作
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入用户名");
        String userName = sc.nextLine();
        System.out.println("请输入密码");
        String code = sc.nextLine();
        if ("zhangsan".equals(userName) && "123456".equals(code)) {
            System.out.println("登录成功");
            LOGGER.info("用户于" + new Date() + "登录成功", userName + "密码为：" + code);
        } else {
            System.out.println("登录失败");
            LOGGER.info("用户于" + new Date() + "登录失败", userName + "密码为：" + code);
        }


    }
}
